<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style type="text/css">
	div,img{
		width: 200px;
		height: 150px;
	}
	img{
		display: none;
	}
</style>
<script type="text/javascript">
	onload = function(){
		var img =document.getElementsByTagName("img")[0];
		img.style.display = "inline-block";
	}
	
	var x =1;
	setInterval( function(){
		var index = x++%3;
		var arr = document.getElementsByTagName("img");
		for(var i=0;i<arr.length;i++){
			arr[i].style.display = i==index? "inline-block":"none";
		}
	},1000)
</script>
</head>
<body>
	<div>
		<img alt="" src="../imgs/1.jpg">
		<img alt="" src="../imgs/2.jpg">
		<img alt="" src="../imgs/6.jpg">
	</div>
</body>
</html>